package com.isoft.demo.controller;/*
 *@ClassName: FindTransferCusController
 *@Date: 2021/6/28
 *@Author:刘逸飞
 */

import com.isoft.demo.common.ResponseData;
import com.isoft.demo.entity.Transport;
import com.isoft.demo.service.FindTransferCusService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
@CrossOrigin
public class FindTransferCusController {

    @Resource
    private FindTransferCusService service;

    @GetMapping("/cus/confirm")
    public ResponseData confirmDate(String sdate,int tid){
        //        获取当前系统时间
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        sdate=format.format(date);

        ResponseData rs = service.confirmDate(sdate,tid);
        return rs;
    }

    @GetMapping("/cus/findtrans")
    public ResponseData findTransSys(){
        ResponseData rs=service.findTranCus();
        return rs;
    }
    @GetMapping("/cus/findtrans/ById")
    public ResponseData findTransSysById(int tid){
        ResponseData rs=service.findTranCusById(tid);
        return rs;
    }

}
